import functionnodes.FunctionNode;
import data.Value;

/**
 * @author loaner
 */
class functionnodes.FunctionNodeEval extends FunctionNode {
	
	function FunctionNodeEval() {
		super();
		funcname = "eval";
//		type = FunctionNode.MACRO;
	}
	
	public function reduceValues( scope:Object, values:Array ) : Value
	{
		//for now let's assume we're getting one Value object whose type is Value.XMLNODE
		var firstarg:Value = values[ 0 ];
		trace("eval is receiving arg " + firstarg );
		var returnval:Value = Evaluator.convertXMLtoValue( firstarg.getXML(), scope );
		trace("eval is returning " + returnval );
		return returnval;
	}

}